package com.yun.quartz.service.impl;

import com.yun.quartz.mapper.SysJobLogMapper;
import com.yun.quartz.domain.SysJobLog;
import com.yun.quartz.service.ISysJobLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class SysJobLogServiceImpl implements ISysJobLogService {

    @Autowired
    private SysJobLogMapper jobLogMapper;

    @Override
    public void addJobLog(SysJobLog jobLog) {
        jobLogMapper.insert(jobLog);
    }

    @Override
    public List<SysJobLog> selectJobLogList(SysJobLog jobLog) {
        return jobLogMapper.selectJobLogList(jobLog);
    }

    @Override
    public SysJobLog selectJobLogById(Long jobLogId) {
        return jobLogMapper.selectById(jobLogId);
    }

    @Override
    public int deleteJobLogByIds(Long[] jobLogIds) {
        return jobLogMapper.deleteJobLogByIds(jobLogIds);
    }

    @Transactional
    @Override
    public void cleanJobLog() {
        jobLogMapper.cleanJobLog();
    }
}
